<template>
	<uni-table class="utable" border emptyText="暂无更多数据" :stripe="false">
		<uni-tr style="margin: 0; padding: 0; " border>
			<uni-th style="font-size: 24rpx;margin: 0; padding: 32rpx;" width="400rpx" align="left">院校/专业名称</uni-th>
			<uni-th style="font-size: 24rpx;margin: 0; padding: 0;" width="100rpx" align="center">录取概率</uni-th>
			<uni-th style="font-size: 24rpx;margin: 0; padding: 0;" width="100rpx" align="center">计划数</uni-th>
			<uni-th v-if="cityNumber==1" style="font-size: 24rpx;margin: 0; padding: 0;" width="100rpx"
				align="center">选科</uni-th>
		</uni-tr>
		<template v-for="(ele, index) in schoolData" :key="index">
			<uni-tr style="background-color: #f8f8f8;">
				<uni-td style="font-size: 28rpx;margin: 0; padding: 32rpx;font-weight: 600;color: #333333;"
					align="left">
					<text>{{`${ele.collegeName}(${ele.collegeEnrollCode}${ele.groupCode ? '-' + ele.groupCode : ''})`  }}</text>
				</uni-td>

				<uni-td style="font-size: 28rpx;margin: 0; padding: 0;font-weight: 600;color: #333333;" align="center">
					{{ele.chance}}%
				</uni-td>
				<uni-td style="font-size: 28rpx;margin: 0; padding: 0;font-weight: 600;color: #333333;"
					align="center">{{ ele.planNum }}</uni-td>
				<uni-td v-if="cityNumber==1"
					style="font-size: 28rpx;margin: 0; padding: 0;font-weight: 600;color: #333333;"
					align="center"></uni-td>

			</uni-tr>
			<uni-tr v-for="(item,index) in ele.majorsInfo" :key="index"
				:style="item.isFit == 0 ? 'color: #999':'color: white'">
				<uni-td style="margin: 0; padding: 32rpx;"
					:style="item.isFit == 0 ? 'color: #666; background-color: #f4f4f4;':''" align="left">
					<view class="table-major">
						<view class="t-m-name" :style="item.isFit == 0 ? 'color: #666':''">
							{{item.professionRealName}}
						</view>
						<view class="t-m-tips" :style="item.isFit == 0 ? 'color: #666':''">
							{{item.remarkExt}}
						</view>
					</view>
				</uni-td>
				<uni-td style="font-size: 28rpx;margin: 0; padding: 0;font-weight: 600;color: #333333;"
					:style="item.isFit == 0 ? 'color: #666; background-color: #f4f4f4;':''" align="center">
					{{item.chance}}%

				</uni-td>
				<uni-td style="font-size: 28rpx;margin: 0; padding: 0;font-weight: 600;color: #333333;"
					:style="item.isFit == 0 ? 'color: #666; background-color: #f4f4f4;':''"
					align="center">{{ item.planNum }}</uni-td>
				<uni-td v-if="cityNumber==1"
					style="font-size: 28rpx;margin: 0; padding: 0;font-weight: 600;color: #333333;"
					:style="item.isFit == 0 ? 'color: #666; background-color: #f4f4f4;':''"
					align="center">{{ item.chooseSubjectText }}</uni-td>
			</uni-tr>

		</template>
		<!-- 四川地区渲染 -->
		<!-- <template  v-if="cityNumber!=2">

		<uni-tr v-for="(item,index) in schoolData" :key="index">
			<uni-td style="margin: 0; padding: 32rpx;" align="left">
				<view class="table-major">
					<view class="t-m-name">
						{{item.professionName}}
					</view>
					<view class="t-m-tips">
						{{item.remark}}
					</view>
				</view>
			</uni-td>
			<uni-td style="font-size: 28rpx;margin: 0; padding: 0;font-weight: 600;color: #333333;" align="center">
				{{item.chance}}%

			</uni-td>
			<uni-td style="font-size: 28rpx;margin: 0; padding: 0;font-weight: 600;color: #333333;"
				align="center">{{ item.zsPlanNum }}</uni-td>
			<uni-td style="font-size: 28rpx;margin: 0; padding: 0;font-weight: 600;color: #333333;"
				align="center">{{ item.sg_info?item.sg_info:item.sp_info?item.sp_info:'-' }}</uni-td>
		</uni-tr>

		</template> -->
	</uni-table>

</template>

<script>
	export default {
		name: "lql-table",
		props: {
			cityNumber: {
				type: Number,
				default: 1
			},
			schoolData: {
				type: Array,
				default: () => []
			}
		},
		data() {
			return {

			};
		},
		watch: {
			cityNumber: {
				handler(newVal) {},
				immediate: true,
				deep: true
			},
			schoolData: {
				handler(newVal) {},
				immediate: true,
				deep: true
			},
		},
		methods: {
			strchaifen(item) {
				const a = item.majorsInfo[0].sg_name.slice(1, 3)
				return a
			},

		}
	}
</script>

<style lang="scss">
	.table-major {
		font-size: 28rpx;
		font-family: PingFangSC-Semibold, PingFang SC;
		font-weight: 600;
		color: #333333;
		display: flex;
		flex-direction: column;
		justify-content: center;

		.t-m-tips {

			font-size: 24rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #999990;
		}
	}

	.text-bgcolor-999 {
		background-color: #999999;
	}

	.text-color-666 {
		color: #666;
	}
</style>